package org.naxx.security;

import org.naxx.security.api.Repository;

/**
 * Repository of all system wide singletons. Used by dynamic
 * objects and services, onces which are not managed by
 * Spring container.
 */
public final class Main {
	
	private static Repository repo;
	
	public static Repository getRepository() {
		return repo;
	}
	
	/**
	 * Should be called only once at the startup of
	 * application.
	 */
	public static void setRepository(Repository repository) {
		repo = repository;
	}
	
	private Main() {
		throw new IllegalStateException("Can not instantiate class '" +
				Main.class.getCanonicalName() + "'");
	}
}
